package cn.mesmile.design.strategy;

/**
 * @author zb
 * @version 1.0
 * @date 2020/11/21 13:30
 * @description
 */
public class DiscountActivity extends Strategy {

    private double rate;

    public DiscountActivity(double rate) {
        this.rate = rate;
    }

    @Override
    public double computePrice(ProductOrder productOrder) {
        double oldPrice = productOrder.getOldPrice();
        return oldPrice * rate;
    }
}
